import Vue from 'vue';
import Vuex from 'vuex';

Vue.use(Vuex);

export default new Vuex.Store({
  state: {
    // message list
    sayList: [],
  },
  mutations: {
    // Add a message
    addSay(state: any, sayCon: string) {
      state.sayList.push(sayCon);
    },
    // Del a message
    delSay(state, index: number) {
      state.sayList.splice(index, 1);
    },
  },
  actions: {},
});
